
package ay.shadow.common.rabbitmq.config;

import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 初始化rabbitMq的连接
 *
 * @author shadow
 */
@Configuration
public class RabbitMqClientConfig {

    /**
     * 初始化mq工厂
     */
    @Bean
    public ConnectionFactory getMqFactory(){
        ConnectionFactory factory = new ConnectionFactory();
        factory.setHost("localhost");
        factory.setUsername("admin");
        factory.setPassword("admin");
        return factory;
    }
}
